package com.kaily.timemanager.db;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;

import com.app.common.db.sqlite.BaseCipDBHelper;
import com.app.common.db.sqlite.BaseDBHelper;

/**
 * Created by zhoulikai on 17/2/27.
 */

public class AppBaseDBHelper extends BaseDBHelper {


    public AppBaseDBHelper(Context context) {
        super(context, AppDatabase.Db.DBNAME, null, AppDatabase.Db.DBVERSION);
    }

    @Override
    public void createTable(SQLiteDatabase db) {
        db.execSQL(AppDatabase.Db.SQL_CREATE_TASK_CLASS_ENTRIES);
        db.execSQL(AppDatabase.Db.SQL_CREATE_TASK_ENTRIES);
        db.execSQL(AppDatabase.Db.SQL_CREATE_THINK_ENTRIES);
    }

    @Override
    public void onUpgrade(SQLiteDatabase db, int i, int i1) {
        super.onUpgrade(db, i, i1);
        db.execSQL(AppDatabase.Db.SQL_DELETE_TASK_CLASS_ENTRIES);
        db.execSQL(AppDatabase.Db.SQL_DELETE_TASK_ENTRIES);
        db.execSQL(AppDatabase.Db.SQL_DELETE_THINK_ENTRIES);
        onCreate(db);

    }
}
